package com.example.mybatis.controller;

import com.example.mybatis.model.UserInfo;
import com.example.mybatis.service.UserService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RequestMapping("/user")
@RestController
public class UserController {
    @Autowired
    private UserService userService;

    @RequestMapping("/getUser")
    public List<UserInfo>getUser(Integer id){
        return userService.getUserInfo(id);
    }

    @RequestMapping("/getUser1")
    public List<UserInfo>getUser1(String username,String password){
        return userService.getUserInfo(username,password);
    }


}
